package com.ygqh.baby.mapper;

import com.ygqh.baby.ao.CheckStatus;
import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.model.YgProductCommentModel;
import com.ygqh.baby.po.YgProductComment;
import com.ygqh.baby.po.YgProductCommentExample;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface YgProductCommentMapper {
    int countByExample(YgProductCommentExample example);

    int deleteByExample(YgProductCommentExample example);

    int deleteByPrimaryKey(Long id);

    int insert(YgProductComment record);

    int insertSelective(YgProductComment record);

    List<YgProductComment> selectByExample(YgProductCommentExample example);

    YgProductComment selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") YgProductComment record, @Param("example") YgProductCommentExample example);

    int updateByExample(@Param("record") YgProductComment record, @Param("example") YgProductCommentExample example);

    int updateByPrimaryKeySelective(YgProductComment record);

    int updateByPrimaryKey(YgProductComment record);

    int count(@Param("groupId") Long groupId, @Param("productId") Long productId);

    List<YgProductCommentModel> selectModel(@Param("queryInfo") QueryInfo queryInfo, @Param("groupId") Long groupId, @Param("productId") Long productId);

    int updateBatchChechStatus(@Param("checkBy") String checkBy, @Param("checkStatus") String checkStatus, @Param("ids") Long[] ids);

    List<YgProductComment> selectForHouTai(@Param("queryInfo") QueryInfo queryInfo, @Param("checkBy") String checkBy, @Param("productName") String productName,
                                           @Param("checkStatus") CheckStatus checkStatus, @Param("startDate") Date startDate, @Param("endDate") Date endDate,
                                           @Param("isUserComment") Boolean isUserComment, @Param("userName") String userName, @Param("orderId") Long orderId);

    int countForHouTai(@Param("checkBy") String checkBy, @Param("productName") String productName, @Param("checkStatus") CheckStatus checkStatus,
                       @Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("isUserComment") Boolean isUserComment,
                       @Param("userName") String userName, @Param("orderId") Long orderId);

    int commentCount(@Param("groupId") Long groupId);

    int countByCurrentGroup(@Param("groupId") Long groupId);

    List<YgProductCommentModel> selectModelListByCurrentGroup(@Param("queryInfo") QueryInfo queryInfo, @Param("groupId") Long groupId);

    List<YgProductCommentModel> selectModelListByProductCode(@Param("queryInfo") QueryInfo queryInfo, @Param("productCode") String productCode,
                                                             @Param("showAll") boolean showAll);

    int countByProductCode(@Param("productCode") String productCode, @Param("showAll") boolean showAll);

    Boolean isCommented(@Param("orderId") Long orderId, @Param("skuId") Long skuId);
}
